package glickrdemo

import org.glickr.FlickrPhoto
import org.glickr.FlickrPlace

class PlaceController {

    def flickrService

    def index() {
//        redirect(action:'getPlaceById')
        redirect(action:'temp')
    }

    def findAll() {
        [photoSet: flickrService.findAll([text:(params.text ?: 'PCD0992'),page:(params.page?:1),perPage:10]) ]
    }

    def getPlaceById() {
        [place: flickrService.getPhotoById(params.long('id') ?: 7957234984)]
    }

    def getPlaceInfo() {
        FlickrPlace place = flickrService.placesGetInfo(new FlickrPlace(id:'nY7EoSRSV7kW'))
        [place: place]
    }

    def temp() {
        def places = flickrService.placeTypes()
        [places: places]
    }
}
